package org.ocean.online.utils;

import java.util.HashMap;
import java.util.Map;

import net.sf.json.JSONObject;

import org.apache.wicket.request.IRequestParameters;

public class ParamUtil {

	public static Map<String,String> toMap(IRequestParameters params){
		Map<String,String> map = new HashMap<String,String>();
		for(String key: params.getParameterNames()){
			map.put(key, params.getParameterValue(key).toString(""));
		}
		return map;
	}
	
	public static Map<String,Object> toMap(JSONObject jobj) {
		Map<String,Object> map = new HashMap<String,Object>();
		for(Object key: jobj.keySet()){
			map.put(key.toString(), jobj.get(key));
		}
		return map;
	}

}
